#pragma once

#include <string>
#include <vector>
#include "Skeleton.h"

using namespace std;

//A frame of animation
class Frame 
{
	//Attributes
	Skeleton* skeleton;   // Holds skeleton nodes
	long time;          // Frame time according to beginning of animation

public:	
	//Constructors & Destructor
	Frame(void);
	~Frame(void);

	//Getters and Setters
	void setTime(const long Time);
	long getTime(void)const;
	Skeleton* getSkeleton(void);
	void setSkeleton(Skeleton* skeleton);
};

//Animation of a gesture
class Animation
{
	string name;
	//Attributes
	vector<Frame*> frames;
public:
	//Constructors & Destructor
	Animation(void);
	~Animation(void);

	void addFrame(Frame* frame); 
	Frame* Animation::operator[](const int frameID);
	const int getFrameCount() const;

	void setName(const char* Name) {name = Name;}
	string getName(void) {return name;}
};

/************************************************************************/
/*                  Frame Methods                                       */
/************************************************************************/

inline void Frame::setTime(const long Time)
{
	time = Time;
}

inline long Frame::getTime(void)const
{
	return time;
}

inline Skeleton* Frame::getSkeleton(void)
{
	return skeleton;
}

inline void Frame::setSkeleton(Skeleton* skeleton)
{
	this->skeleton = skeleton;
}

/************************************************************************/
/*                  Frame Methods                                       */
/************************************************************************/

inline void Animation::addFrame(Frame* frame)
{
	frames.push_back(frame);
}

inline Frame* Animation::operator[](const int frameID)
{
	return frames[frameID];
}

inline const int Animation::getFrameCount() const
{
	return frames.size();
}